package com.leyun68.server.controller;

import com.leyun68.server.pojo.echartscount.DegreeCount;
import com.leyun68.server.pojo.echartscount.NativePlace;
import com.leyun68.server.service.IEmployeeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 图表数据
 */
@RestController
@Api(tags = "EChartsController 首页图表数据")
@RequestMapping("/echarts")
public class EChartsController {

    @Autowired
    private IEmployeeService employeeService;

    @ApiOperation(value = "学历数据统计")
    @GetMapping("/tiptopdegree")
    public List<DegreeCount> getTiptopDegree() {
        return employeeService.getCountDegree();
    }

    @ApiOperation(value = "员工地区分布")
    @GetMapping("/nativePlace")
    public List<NativePlace> getNativePlace() {
        return employeeService.getNativePlace();
    }
}
